<?php
class Zend_View_Helper_Navigation
{
    public $view;

    public function navigation ()
    {
        $html = '
        <div class="path" id="nav">
            <ul>
                <li><a href="/">Главная</a></li>';
        $postService = Service_Post::getInstance();
        foreach($postService->getMainPosts() as $post){
            $html .= '<li><a href="/post/view/id/' . $post->id . '">' . $post->title . '</a></li>';
        }
        
        $html .='
            </ul>
            <div class="clearer"></div>
        </div>';
        return $html;
    }
    /**
     * Sets the view field 
     * @param $view Zend_View_Interface
     */
    public function setView (Zend_View_Interface $view)
    {
        $this->view = $view;
    }
}

